package com.example.warehousewms.mapper;

import com.example.warehousewms.bean.Inventory;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

@Mapper
public interface InventoryMapper {

    int insertInventory(Inventory inventory);

    int updateInventory(Inventory inventory);

    int deleteInventory(Long id);

    Inventory getInventoryById(Long id);

    Inventory getInventoryByProductIdAndLocationId(Long productId, Long locationId);

    List<Inventory> getAll();

    int reduceQuantityWithLock(Long productId, Long locationId, Integer quantity, Integer version);
}
